import React from 'react';
import { Icon, Form } from '@knownsec/react-component';
import CheckboxGroup from '../../components/CheckboxGroup';
import SelectAnt from '@/components/SelectAnt';
import s from './style.module.css';
const INFORM_OPTIONS = [
  {
    value: 'email',
    label: '邮件',
  },
  {
    value: 'sms',
    label: '短信',
    tip: '123',
  },
];
const defaultData = {
  note0: 'aaa',
};
export default function testPage() {
  const createForm = React.useRef();
  const [value, setValue] = React.useState({ email: false, sms: false });
  const onValues = (data) => {
    console.log('data', data);
    createForm.current.setFieldsValue(data);
  };
  return (
    <div>
      <Icon type="buy"></Icon>
      <CheckboxGroup
        checked={value}
        options={INFORM_OPTIONS}
        onChange={(e) => {
          console.log('eee', e);
        }}
      ></CheckboxGroup>
      <Form
        ref={createForm}
        initialValues={defaultData}
        name="control-ref"
        onValuesChange={(newItem) => {
          onValues(newItem);
        }}
      >
        <Form.Item name="note0" label="云端可用性" className={s.item}>
          <SelectAnt
            option={[
              { value: 'qqq', label: 'www' },
              { value: 'aaa', label: 'www123' },
            ]}
            className={s.SelectAnt}
          />
        </Form.Item>
      </Form>
    </div>
  );
}
